package logogui;

import java.util.Vector;

public class Procedure {
	private String nom_procedure;
	private Vector<String> noms_parametres;
	private int debut_procedure = 0;
	private int fin_procedure = 0;

	public Procedure() {
		nom_procedure = new String("");
		noms_parametres = new Vector<String>();
	}

	public Procedure(String name) {
		nom_procedure = name;
		noms_parametres = new Vector<String>();
	}

	public void afficher() {
		System.out.println("Procedure " + nom_procedure +" :: " + noms_parametres);
	}
	
	public void setDebut(int d) {
		debut_procedure = d;
	}

	public int getDebut() {
		System.out
				.println("nom=" + nom_procedure + " debut=" + debut_procedure);
		return debut_procedure;
	}

	public String getName() {
		return nom_procedure;
	}

	public void setFin(int i) {
		fin_procedure = i;
	}

	public int getFin() {
		return fin_procedure;
	}

	public void addNomParam(String p) {
		int index = noms_parametres.indexOf(p);
		if (index == -1) {
			noms_parametres.add(p);
		} else {
			noms_parametres.setElementAt(p, index);
		}
	}

	public Vector<String> getNomsParams() {
		return noms_parametres;
	}

	public int getNbParams() {
		return noms_parametres.size();
	}
}
